package org.itsky.provider;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;

/**
 * @Author sky
 * @Site cmtianxie163.com 2020/4/2 10:23
 */
@Controller
public class HelloController {
    @Value("${server.port}")
    Integer port;

    @GetMapping("hello")
    @ResponseBody
    public String hello(){
        return "hello sky :"+port;
    }

    @GetMapping("/hello2")
    @ResponseBody
    public String hello2(String name){
        System.out.println(new Date() + ">>> " + name);
        return "hello " + name;
    }
}
